package mylab.io.base.property;

import com.google.common.base.Joiner;

import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NonNull;
import lombok.Setter;

/**
 * 通讯协议描述
 */
@Getter
@Setter
@EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = false)
public class ProtocolAttrs {

    /**
     * 协议代码
     */
    @NonNull
    @EqualsAndHashCode.Include
    protected String code = "UnknownProtocol";

    /**
     * 协议版本
     */
    @EqualsAndHashCode.Include
    protected String version;

    /**
     * 协议名称
     */
    protected String name;


    @Override
    public String toString() {
        return Joiner.on("-").skipNulls().join(code, version);
    }
}
